Add barrier label rendering with barrier_label_len to the Rust circuit drawer - #16598
Open
kmbys wants to merge 1 commit into
Open
Add barrier label rendering with barrier_label_len to the Rust circuit drawer#16598kmbys wants to merge 1 commit into
kmbys wants to merge 1 commit into
Conversation
…t drawer Part of Qiskit#16464. Ports the barrier label rendering of the Python text drawer (including the barrier_label_len truncation added in Qiskit#15776) to the Rust circuit drawer. The label is drawn above the top-most wire of the barrier and truncated to barrier_label_len characters with a '...' suffix when it exceeds that length, matching the Python text drawer output character-for-character. The C API's QkCircuitDrawerConfig struct gains a barrier_label_len field; 0 selects the default of 16 characters, so existing initializers that omit the field keep the previous default behavior. Part of Qiskit#16464
Collaborator
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #16464 (do not auto-close: this is one item of the tracking issue).
Summary
The Rust circuit drawer previously did not render
Barrierlabels at all.This PR ports the barrier label rendering of the Python text drawer,
including the
barrier_label_lentruncation behavior added in #15776:wires keep the plain
░column, matching the Python text drawer.barrier_label_lencharacters are truncated at thatlength with a
...suffix.draw_circuitgains abarrier_label_lenargument, and the C API'sQkCircuitDrawerConfigstruct gains abarrier_label_lenfield.0selects the default of 16 characters, so existing structinitializers that omit the field keep the previous behavior.
Details and comments
OnWireElement::Barriernow carries a reference to its instruction sothe label is available at render time.
qiskit==2.5.0output, in both merged and unmerged wire modes.length, a barrier whose top-most wire is not the first wire of the
circuit, and a label of exactly 16 characters (not truncated).
features_crelease note is included for the newQkCircuitDrawerConfigfield.AI/LLM disclosure